/*下拉框转换*/
module.exports = {
	selectTransformat: function() {
		Handlebars.registerHelper('select', function(value, options) {
			var $el = $('<select />').html(options.fn(this));
			$el.find('[value="' + value + '"]').attr({
				'selected': 'selected'
			});
			return $el.html();
		});
	},
	transformatStatus: function(type) {
		Handlebars.registerHelper("transformat", function(value) {
			if (value == 0) {
				return type ? "正常" : "预定";
			} else if (value == 1) {
				return type ? "冻结" : "已报检";
			} else if (value == 2) {
				return type ? "删除" : "海关查验";
			}else if (value == 3) {
				return "放行";
			}
		});
		Handlebars.registerHelper("costTransformat", function(value) {
			return (!value) ? "" : ("￥"+value);
		});
	}
}